#include "Communication/SubOffGroundSwitch.h"
#include "modules/CtrlModule/ActivePlanner/CliffFollowPlanner.h"
#include "data_struct/base/DataSet.h"

namespace behavior_controller
{
    OffGroundSwitchData DataSet::off_ground_switch;
    namespace SubOffGroundSwitch
    {
        
        static rclcpp::Subscription< std_msgs::msg::Bool>::SharedPtr offGroundSwitchSub;
        void sub_callback(const std_msgs::msg::Bool::SharedPtr msg)
        {
            
            DataSet::off_ground_switch.SetData(msg->data);
        }

        void SubOffGroundSwitchInfo(rclcpp::Node::SharedPtr &node_handle)
        {
            offGroundSwitchSub = node_handle->create_subscription<std_msgs::msg::Bool>(
                "off_ground_switch", rclcpp::SensorDataQoS(), sub_callback);
            std::cout << "SubOffGroundSwitch SubOffGroundSwitchInfo" << std::endl;
        }
    } // namespace SubOffGroundSwitch

} // namespace behavior_controller